package bigoo.peer;

import java.util.Collection;
import java.util.LinkedList;

public class PublishRideMessage {

    private Collection<Ride> rides = new LinkedList<Ride>();
    private final String senderID;

    public PublishRideMessage(String senderID) {
	this.senderID = senderID;
    }

    public PublishRideMessage(String senderID, Collection<Ride> rides) {
	this(senderID);
	this.rides = rides;
    }

    public void addRide(int destination, String rideID, String peerID, int places, int timestamp, int version) {
	this.rides.add(new Ride(destination, rideID, peerID, places, timestamp, version));
    }

    public Collection<Ride> getRides() {
	return this.rides;
    }

    public String getSenderID() {
	return this.senderID;
    }

}
